package bean

import "strconv"

type UserBean struct {
	SessionID string `json:"session_id"`
	UserID    int64  `json:"user_id"`
	Name      string `json:"name"`
	Portrait  string `json:"portrait"`
}

func NewUserBean(m map[string]string) *UserBean {
	bean := UserBean{}
	id, _ := strconv.ParseInt(m["user_id"], 10, 64)
	bean.UserID = id
	bean.Name = m["name"]
	bean.Portrait = m["portrait"]
	return &bean
}
